window.onload = function() {

    let btn = document.querySelector("button")
    btn.addEventListener("click", (e) => {
        e.preventDefault()

        let username = document.getElementById("username").value
        let password = document.getElementById("password").value

        axios.get("http://172.19.1.251:8080/login",{
             params: {
                name:username,
                key:password
            }
        }).then((res)=>{
            console.log(res.data)
        })
    })

    let dl = document.querySelector("#dl")
    dl.addEventListener("click", (e) => {
        e.preventDefault()

        let username = document.getElementById("username").value
        let password = document.getElementById("password").value

        axios.post("http://127.0.0.1:8080/login",{
             name:username,
             key:password

        }).then((res)=>{
            console.log(res.data)
        })
    })
}